<template>
  <div class="base_header w-full h-10 flex justify-between items-center">
    <div class="logo flex justify-between items-center"><img src="@/assets/logo.png" alt="" /> vue3后台管理系统</div>
    <div class="Logout">
      <div class="col">
        <fullScreen :isFullscreen="isFullscreen" :changeFullScreen="toggle" />
        <a-dropdown>
          <template #overlay>
            <a-menu>
              <a-menu-item>
                <a href="javascript:;" @click="handleLogout">退出登录</a>
              </a-menu-item>
            </a-menu>
          </template>
        </a-dropdown>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
import { useFullscreen } from '@vueuse/core'
import fullScreen from './fullScreen'

import useGlobal from '@/hooks/useGlobal'
const { router } = useGlobal()
const { isFullscreen, toggle } = useFullscreen()

/**
 * @method 退出登录
 */
const handleLogout = () => {
  router.push({ name: 'login' })
}
</script>

<style scoped lang="less">
.base_header {
  height: 44px;
}
.Logout {
  display: flex;
  margin-left: auto;
  padding: 0 20px;
  box-sizing: border-box;
  flex-direction: row-reverse;
  .col {
    height: 44px;
    line-height: 44px;
    font-size: 12px;
    color: #3d7cff;
    cursor: pointer;
    transition: 0.3s all;
    display: flex;
    align-items: center;

    a {
      color: #3d7cff;
      line-height: 26px;
      display: inline-block;
      padding: 0 12px;
      .initials {
        display: inline-block;
        width: 22px;
        height: 22px;
        line-height: 22px;
        background: #006eff;
        color: #fff;
        border-radius: 50%;
        text-align: center;
      }
      &:hover {
        color: #115eff;
      }
    }
    &:hover {
      color: #115eff;
    }
    .col-select {
      background: #f0f7ff;
      padding: 0 15px;
      box-sizing: border-box;
      border-radius: 13px;
      width: 150px;
      height: 26px;
      line-height: 26px;
      position: relative;
      .ant-dropdown-link {
        width: 100%;
        display: -webkit-box;
        color: #3d7cff;
        font-weight: bold;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 1; /*这里设置几行*/
        overflow: hidden;

        .anticon {
          position: absolute;
          right: 10px;
          top: 8px;
          color: #afaeae;
        }
      }
    }
  }
}

.col-right {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 25px;
  .right-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-left: 25px;
    cursor: pointer;
    // .img-bill {
    // }
  }
  img {
    margin-right: 0px;
  }
  span {
    margin-top: 2px;
    font-size: 12px;
    color: #3d7cff;
    font-weight: 500;
  }
  .img-pad {
    width: 12px;
    height: 14px;
  }
  .img-sgggt {
    width: 14px;
    height: 12px;
  }
  :deep(.ant-popover-inner-content) {
    padding: 25px;
  }
  :deep(.ant-popover-inner) {
    border-radius: 10px;
  }
}

.dropdown-container {
  margin-left: 30px;
  :deep(.ant-dropdown) {
    top: 40px !important;
  }
  .top-title {
    color: #3d7cff;
    margin-right: 10px;
  }
  :deep(.anticon-down) {
    color: #3d7cff;
  }
  :deep(.ant-dropdown-menu-item) {
    color: #333333;
    padding: 5px 15px;
    &:hover {
      color: #3d7cff;
      background-color: rgba(#3d7cff, 0.1);
    }
  }
  :deep(.ant-dropdown-menu-title-content) {
    text-align: center;
  }
  :deep(.ant-dropdown-menu) {
    border-radius: 5px;
  }
}
</style>
